  /*请求url*/


Page({
	data:{
		showView: true,
    	tishi:"还没有上传任何动态"
		/*url*/
	},
	/*
		页面加载
	*/
	onLoad:function(e){
		var that = this;
		wx.request({
		    url:"that.data.listUrl", 
		    method: "get",
		    data: {
		        //发给后台
		        user_id:that.data.userId,
		        role:that.data.userRole
		    },
		    header: {
		        'content-type': 'application/x-www-form-urlencoded'
		    },
		    success: function (res) {
		        if (res.data.code == 0) {
		        	 // 判断后台返回的对象数组里面有没有东西，有则把提示去掉
         			 if(res.data.course_name!=null){
		            	that.listData(res);
		            }
		        }
		    },
		    fail: function (res) {
		        console.log('刷list数据失败');
		    }
		});
		/*wx.getStorage({
			key:'loginConf',
			success:function(res){
				that.setData({
					userId : res.data.userId,
					userRole : res.data.userRole
				});
				//发送userId和userRole，返回页面list
				wx.request({
				    url:that.data.listUrl, 
				    method: "get",
				    data: {
				        //发给后台
				        user_id:that.data.userId,
				        role:that.data.userRole
				    },
				    header: {
				        'content-type': 'application/x-www-form-urlencoded'
				    },
				    success: function (res) {
				        if (res.data.code == 0) {
				            that.listData(res);
				        }
				    },
				    fail: function (res) {
				        console.log('刷list数据失败');
				    }
				});
			}
		});*/
	},
	listData:function(res){
		this.setData({
			array : res.data.list,
			showView: false
		});
	},

  });